import { Component } from 'react'
import observer from './observer'
class Child1 extends Component {
    componentDidMount() { // componentDidMount 相当于vue的mounted
        observer.subscribe((data) => {
            console.log(data)
        })
    }
    render() {
        return <div>这是子组件一</div>
    }
}

export default Child1